using System;
using NUnit.Framework;

namespace Org.JSON.Test.Serialization
{
	[TestFixture]
	public class String
	{
		[Test]
		public void Empty()
		{
			Assert.AreEqual("\"\"", new Org.JSON.String("").Serialize());
		}

		[Test]
		public void Simple()
		{
			Assert.AreEqual("\"X\"", new Org.JSON.String("X").Serialize());
		}

		[Test]
		public void QuoteEscaped()
		{
			Assert.AreEqual("\"\\\"\"", new Org.JSON.String("\"").Serialize());
		}

		[Test]
		public void SlashEspaced()
		{
			Assert.AreEqual("\"\\\\\"", new Org.JSON.String("\\").Serialize());
        }

		[Test]
		public void OtherEscapedChars()
		{
			Assert.AreEqual("\"\\n\\r\\f\\b\\t\"", new Org.JSON.String("\n\r\f\b\t").Serialize());
		}

		[Test]
		public void EscapedControl()
		{
			Assert.AreEqual("\"\\u0000\\u001f\\u0080\\u007f\"", new Org.JSON.String("\u0000\u001f\u0080\u007F").Serialize());
		}


	}
}

